package com.happycat.utils;

import java.io.UnsupportedEncodingException;

import org.apache.tomcat.util.codec.binary.Base64;

public class Base64Util {

	public static String decode(String userId) {
		return new String(Base64.decodeBase64(userId));
	}

	public static String encode(String userId) {
		
		return new String(Base64.encodeBase64(userId.getBytes()));
	}
	public static void main(String[] args) {
		String userid = "123123";
		String base64UserId = encode(userid);
		System.out.println(base64UserId);
		String userId = decode(base64UserId);
		System.out.println(userId);
	}
	
}
